/**************************************************************************
 * $RCSfile: DictionaryDropDownListener.java,v $  $Revision: 1.1 $  $Date: 2009/01/07 08:18:06 $
 *
 * $Log: DictionaryDropDownListener.java,v $
 * Revision 1.1  2009/01/07 08:18:06  @author simplefan
 * add properites show page
 *
 **************************************************************************/
package com.simplefan.meta.determine.client.web.listener;

import java.util.List;

import com.bstek.dorado.common.DoradoContext;
import com.bstek.dorado.data.Dataset;
import com.simplefan.application.basic.common.po.Dictionary;
import com.simplefan.meta.determine.client.desktop.service.MetaPlatformServiceFacade;

/**
 * @author K
 */
public class DictionaryDropDownListener extends MetaPlatformListener
{
  @Override
  public void afterLoadData(Dataset dataset) throws Exception {
    super.afterLoadData(dataset);
    MetaPlatformServiceFacade facade = getServiceFacade();
    String className = DoradoContext.getContext().getParameter("className");
    String attributeName = DoradoContext.getContext().getParameter("attributeName");
    if( className != null && className.length() > 0 && attributeName != null && attributeName.length() > 0 ){
      List<Dictionary> list = facade.queryDictionary(className, attributeName);
      dataset.fromDO(list);
    }
  }

}
